/************************************************************************

								Heroes IV
					  Copyright 2001, The 3DO Company

	------------------------------------------------------------------
  						       war_institute.h

	$Header: /game/war_institute.h $

	$NoKeywords: $

 ************************************************************************/

#ifndef WAR_INSTITUTE_H_INCLUDED
#define WAR_INSTITUTE_H_INCLUDED

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "single_use_object.h"
#include "skill_set.h"

// -------------------------------------------------------------
// Hero can upgrade a skill from visiting the war institute
// -------------------------------------------------------------
class t_war_institute : public t_single_use_object
{
public:
	t_war_institute( std::string const& source );
    
    virtual void		 activate_trigger( t_army* army, t_adv_map_point const& point, 
										   t_direction direction, t_adventure_frame* frame );

	virtual float		 ai_value( t_adventure_ai const& ai, t_creature_array const& army, int move_cost ) const;
	virtual float		 ai_value_to_hero( t_hero const* hero, t_creature_array const* array ) const;

	virtual int          get_version() const;
	virtual bool         read( std::streambuf&						stream, 
						       t_qualified_adv_object_type const&	type,
						       int									version );
	virtual bool		 read_from_map( std::streambuf& stream, t_progress_handler* progress);
	virtual void         right_click( t_mouse_event const& event,
		                              t_adventure_frame* adventure_frame );
	virtual void		 visit( t_hero* hero ); 
	virtual bool         write( std::streambuf& stream ) const;

protected:
	t_war_institute(t_skill_set const &available_skills, std::string const& source );

	std::vector<t_skill> get_upgradable_skills( t_hero* hero ) const; 
	bool				 has_upgradable_skills( t_hero* hero ) const;
    
	virtual std::vector<t_hero*> select_heroes_dialog( std::vector<t_hero*> const& heroes, 
													   std::vector<t_hero*> const& selectable_heroes,
													   t_window* parent, t_army* army );

	t_skill_set m_available_skills;
	t_skill_set m_preferred_skills;
	
};

#endif // WAR_INSTITUTE_H_INCLUDED

